import Vue from 'vue'
import VueRouter from 'vue-router'

import MyLogin from '@/components/MyLogin.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component:MyLogin
  },
  {
    path: '/home',
    component:() => import('@/components/MyHome.vue'),
    children: [
      { path: 'goods', component: () => import('@/components/menus/MyGoods.vue') },
      { path: 'orders', component: () => import('@/components/menus/MyOrders.vue') },
      { path: 'rights', component: () => import('@/components/menus/MyRights.vue') },
      { path: 'settings', component: () => import('@/components/menus/MySettings.vue') },
      { path: 'users', component: () => import('@/components/menus/MyUsers.vue') },
      { path: 'detail/:id', component: () => import('@/components/user/MyUserDetail.vue') },
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
